//package com.btex.app.pager;
//
//import android.content.Intent;
//import android.os.Bundle;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//
//import com.lidroid.xutils.HttpUtils;
//import com.lidroid.xutils.exception.HttpException;
//import com.lidroid.xutils.http.ResponseInfo;
//import com.lidroid.xutils.http.callback.RequestCallBack;
//import com.lidroid.xutils.http.client.HttpRequest;
//import com.lidroid.xutils.util.PreferencesCookieStore;
//import com.btex.app.Config;
//import com.btex.app.R;
//import com.btex.app.TabsActivity;
//import com.btex.app.entity.UserInfo;
//import com.btex.app.tools.CookieTool;
//import com.btex.app.tools.LogUtil;
//
//import org.json.JSONException;
//import org.json.JSONObject;
//
///**
// * Created by wcx on 16/3/16.
// */
//public class FragmentAdmin extends BaseFragment {
//    private static final java.lang.String TAG = "FragmentAdmin";
//    private View view;
////    private LinearLayout llLogout,llMyAcount,llMyMoney,llChongZhiRMB,llChongZhiCard,
////            llTiXian,llCardManagement,llIntoCoin,llOutCoin,llTradeRecord,llEntrust_Record,llFenHong;
////    private TextView tvMyMoney,tvMyAcount,tvMyUID;
//    private PreferencesCookieStore cookieStore;
//    private UserInfo userInfo;
//
//
//
//    @Override
//    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//        view = View.inflate(getActivity(), R.layout.fragment_myself, null);
////        llLogout = (LinearLayout) view.findViewById(R.id.ll_logout);
////        llMyAcount = (LinearLayout) view.findViewById(R.id.llMyAcount);
////        llMyMoney = (LinearLayout) view.findViewById(R.id.llMyMoney);
////        llChongZhiRMB = (LinearLayout) view.findViewById(R.id.llChongZhiRMB);
////        llChongZhiCard = (LinearLayout) view.findViewById(R.id.llChongZhiCard);
////        llTiXian = (LinearLayout) view.findViewById(R.id.llTiXian);
////        llCardManagement = (LinearLayout) view.findViewById(R.id.llCardManagement);
////        llIntoCoin = (LinearLayout) view.findViewById(R.id.llIntoCoin);
////        llOutCoin = (LinearLayout) view.findViewById(R.id.llOutCoin);
////        llTradeRecord = (LinearLayout) view.findViewById(R.id.llTradeRecord);
////        llEntrust_Record = (LinearLayout) view.findViewById(R.id.llEntrust_Record);
////        llFenHong = (LinearLayout) view.findViewById(R.id.llFenHong);
////        tvMyUID = (TextView) view.findViewById(R.id.tvMyUID);
////        tvMyAcount = (TextView) view.findViewById(R.id.tvMyAcount);
////        tvMyMoney = (TextView) view.findViewById(R.id.tvMyMoney);
////
////
////        llLogout.setOnClickListener(this);
////        llMyAcount.setOnClickListener(this);
////        llMyMoney.setOnClickListener(this);
////        llChongZhiRMB.setOnClickListener(this);
////        llChongZhiCard.setOnClickListener(this);
////        llTiXian.setOnClickListener(this);
////        llCardManagement.setOnClickListener(this);
////        llIntoCoin.setOnClickListener(this);
////        llOutCoin.setOnClickListener(this);
////        llTradeRecord.setOnClickListener(this);
////        llEntrust_Record.setOnClickListener(this);
////        llFenHong.setOnClickListener(this);
//
//        return view;
//    }
//
//    @Override
//    public void setData() {
//
//    }
//
//    @Override
//    public void onResume() {
//        super.onResume();
//    }
//
////    @Override
////    public void onClick(View v) {
////        Intent i;
////        String url;
////        switch (v.getId()){
////            case R.id.ll_logout:
////                toLogout();
////                break;
////            case R.id.llMyAcount:
////                i = new Intent(cxt, WebActivity.class);
////                i.putExtra("web_url",Config.URL+"home/my_account");
////                startActivity(i);
////                break;
////            case R.id.llMyMoney:
////                i = new Intent(cxt, MyCoinsActivity.class);
////                i.putExtra("userInfo",userInfo);
////                startActivity(i);
////                break;
////            case R.id.llChongZhiRMB:    //人民币充值
////                i = new Intent(cxt, WebActivity.class);
////                url = Config.URL+"home/chongzhi/pay";
////                i.putExtra("web_url",url);
////                startActivity(i);
////                break;
////            case R.id.llChongZhiCard:   //充值卡充值
////                i = new Intent(cxt, WebActivity.class);
////                url = Config.URL+"home/chongzhi/card";
////                i.putExtra("web_url",url);
////                startActivity(i);
////                break;
////            case R.id.llTiXian:      //提现
////                i = new Intent(cxt, WebActivity.class);
////                url = Config.URL+"home/tixian";
////                i.putExtra("web_url",url);
////                startActivity(i);
////                break;
////            case R.id.llCardManagement:    //银行卡管理
////                i = new Intent(cxt, WebActivity.class);
////                url = Config.URL+"home/bankcard";
////                i.putExtra("web_url",url);
////                startActivity(i);
////                break;
////            case R.id.llIntoCoin:      //虚拟币转入
////                i = new Intent(cxt, WebActivity.class);
////                url = Config.URL+"home/coins/deposit";
////                i.putExtra("web_url",url);
////                startActivity(i);
////                break;
////            case R.id.llOutCoin:     //虚拟币转出
////                i = new Intent(cxt, WebActivity.class);
////                url = Config.URL+"home/coins/withdraw";
////                i.putExtra("web_url",url);
////                startActivity(i);
////                break;
////            case R.id.llTradeRecord:    //交易纪录
////                i = new Intent(cxt, WebActivity.class);
////                url = Config.URL+"home/coins/trade";
////                i.putExtra("web_url",url);
////                startActivity(i);
////                break;
////            case R.id.llEntrust_Record:   //委托纪录
////                i = new Intent(cxt, WebActivity.class);
////                url = Config.URL+"home/coins/orders";
////                i.putExtra("web_url",url);
////                startActivity(i);
////                break;
////            case R.id.llFenHong:   //委托纪录
////                i = new Intent(cxt, WebActivity.class);
////                url = Config.URL+"home/fenhong_m";
////                i.putExtra("web_url",url);
////                startActivity(i);
////                break;
////        }
////    }
//
//    private void toLogout() {
//
//
//        new HttpUtils().configCookieStore(cookieStore).send(HttpRequest.HttpMethod.GET, Config.URL_USER_LOGOUT, new RequestCallBack<String>() {
//            @Override
//            public void onSuccess(ResponseInfo<String> responseInfo) {
//                String result = responseInfo.result.toString();
//                LogUtil.i(TAG,"result:"+result);
//                try {
//                    JSONObject json = new JSONObject(result);
//                    if("1".equals(json.getString(Config.KEY_CODE))){
//                        sp.putBoolean(Config.KEY_IS_LOGIN, false);
//                        sp.putString(Config.TOKEN, null);
//                        Intent i = new Intent(cxt,TabsActivity.class);
//                        LogUtil.v("xm-----", 1 + "");
//                        getActivity().startActivity(i);
//                        LogUtil.v("xm-----", 2 + "");
//                        getActivity().finish();
//                        LogUtil.v("xm-----", 4 + "");
//                    }
//                } catch (JSONException e) {
//                   LogUtil.e(TAG,e.toString());
//                }
//            }
//
//            @Override
//            public void onFailure(HttpException error, String msg) {
//
//            }
//        });
//    }
//
//
//    @Override
//    public void setUserVisibleHint(boolean isVisibleToUser) {
//        super.setUserVisibleHint(isVisibleToUser);
//        if(isVisibleToUser){
//            getUserInfo();
//        }
//    }
//
//    private void getUserInfo() {
//        cookieStore = CookieTool.getCookieStore(cxt,sp);
//        LogUtil.i(TAG, "cookieStore:"+cookieStore.getCookies().toString());
//       new HttpUtils().configCookieStore(cookieStore).send(HttpRequest.HttpMethod.GET, Config.URL_MY_INFO, new RequestCallBack<String>() {
//           @Override
//           public void onSuccess(ResponseInfo<String> responseInfo) {
//               String reuslt = responseInfo.result.toString();
//
////               try {
////                   JSONObject jSONObject  = new JSONObject(reuslt);
////                   if("1".equals(jSONObject.getString(Config.KEY_CODE))){
////                       Gson gson = new Gson();
////                       userInfo = gson.fromJson(jSONObject.getString(Config.KEY_DATA),UserInfo.class);
////                       if(userInfo!=null){
////                           tvMyUID.setText(userInfo.getId());
////                           if(userInfo.getMobile()!=null&&!"".equals(userInfo.getMobile()))
////                                 tvMyAcount.setText(userInfo.getMobile());
////                           else
////                               tvMyAcount.setText(userInfo.getEmail());
////                           tvMyMoney.setText(userInfo.getTotal_fund());
////                       }
////
////                   }else if("-2".equals(jSONObject.getString(Config.KEY_CODE))){
////                       sp.putBoolean(Config.KEY_IS_LOGIN, false);
////                       TabsActivity.layout_content.setCurrentItem(Config.TAB_FRAGMENT5, false);
////                   }
////               } catch (Exception e) {
////                   e.printStackTrace();
////               }
//           }
//
//           @Override
//           public void onFailure(HttpException error, String msg) {
//           }
//       });
//    }
//}
